<template>
  <div class="containers">
    <div class="container">
      <div class="form-box" style="width: 100%;max-width: 900px;">
        <el-tabs >
          <el-tab-pane label="三方接口设置" >
            <el-form ref="form" label-width="120px">
              <el-form-item label="是否开启">
                <el-switch  v-model="form.is_open" :active-value="1" :inactive-value="0"></el-switch>
              </el-form-item>
              <el-form-item label="url">
                <el-input  v-model="form.url"></el-input>
              </el-form-item>
              <el-form-item label="token">
                <el-input  v-model="form.token"></el-input>
              </el-form-item>
              <span class="dialog-footer">
                <el-button type="prove" @click="setlv()">确 定</el-button>
              </span>
            </el-form>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>

<script>


export default {


  data() {
    return {
      form:{
        url:"",
        token:"",
        is_open:0,
      }

    };
  },
  created() {
    this.load()//获取
  },
  methods: {
    setState(){

    },
    load() {
      this.request('admin/settlementSet/', 'get', {}).then(
        res => {
          if (res.errno == 0) {
            console.log('res',res)
              this.form=res.data
          }
        },
        function () {
          console.log('请求失败处理');
        }
      );


    },

    setlv() {
      this.request('admin/settlementSet/', 'post',  this.form).then(
        res => {
          if(res.errno==0){
          this.$message.success(res.errmsg);

        }else{
          this.$message.error(res.errmsg);
        }

        },
        function () {
          console.log('请求失败处理');
        }
      );
    },




  }
};
</script>
<style scoped="scoped">
.container {
  padding: 20px;
}

.activeattr {
  border: 1px solid rgb(64, 158, 255);
  color: rgb(64, 158, 255);
}

.el-upload {
  width: 100px !important;
  height: 100px !important;
}
</style>
